package cn.edu.xmu.orderpayment.order.microservice.retvo;

import cn.edu.xmu.orderpayment.order.model.enums.RegionState;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author Yujie Lin
 * @date 2021/12/8 17:20
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class RegionRetVo {
    private Long id;
    private Long pid;
    private String name;
    private Byte state;

    public RegionState getState() {
        return RegionState.getRegionStateByCode(Integer.valueOf(state));
    }

    public void setState(RegionState state) {
        this.state=state.getCode().byteValue();
    }
}
